import React, { useState, useEffect } from 'react';

export default function App(){
    const [count,setCount] = useState(0);

    useEffect(()=>{
        console.log('useEffect',count)
    },[count])

    const handleClick = () => {
        console.log('111',count)
        setCount(count+1);
        console.log('222',count)
    }

    return (
        <div>
            <p>count:{count}</p>
            <p><button onClick={handleClick}>click</button></p>
        </div>
    )
}